package com.pd.domain;

import com.pd.constant.SysContant;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by dong peng
 * DATE : 2017/2/26
 * TIME : 22:15.
 */


public class ResponseVo {

    private SysContant tip;
    private String code;
    private String msg;
    /**
     * 详细描述
     */
    private String desc;
    private Map<String,Object> retData = new HashMap();


    public SysContant getTip() {
        return tip;
    }

    public void setTip(SysContant tip) {
        this.tip = tip;
        if(code == null) {
            this.code = tip.getCode();
        }

        if(msg == null) {
            this.msg = tip.getMsg();
        }
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public void setRetData(Map<String, Object> retData) {
        this.retData = retData;
    }

    public void addRetData(String key,Object obj) {
        if(obj != null) {
            this.retData.put(key,obj);
        }
    }

    public Map<String, Object> getRetData() {
        return retData;
    }

    @Override
    public String toString() {
        return "ResponseVo{" +
                "tip=" + tip +
                ", code='" + code + '\'' +
                ", msg='" + msg + '\'' +
                ", desc='" + desc + '\'' +
                ", retData=" + retData +
                '}';
    }
}
